package com.starbaba.base.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.base.common.exception.AppException;
import com.base.common.log.LogService;
import com.starbaba.base.dao.LoanManagerBaseDao;
import com.starbaba.base.service.CommProductChannelService;
import com.starbaba.channel.model.Comm_product_channel;

public class CommProductChannelServiceImpl extends LoanManagerBaseDao implements CommProductChannelService{

	@Override
	public Map<String, String> getCommProductChannelMap() {
		
		Map<String, String> map = new HashMap<String, String>();
		try {
			String sql = "SELECT * FROM `comm_product_channel`";
			List<Comm_product_channel> list = getDao().list(sql, Comm_product_channel.class);
			if(list != null && list.size() > 0){
				for(Comm_product_channel channel: list){
					map.put(String.valueOf(channel.getChannel_code()), channel.getChannel_name());
				}
			}
		} catch (AppException e) {
			LogService.error(e);
		}
		return map;
	}

}
